var data = [
    { "progress": "60", "Department": "全部费用", "type": "Total" },
    { "progress": "30", "Department": "生产部门", "type": "Dtl" },
    { "progress": "30", "Department": "电气部门", "type": "Dtl" },
    { "progress": "30", "Department": "仪表部门", "type": "Dtl" },
    { "progress": "30", "Department": "外输部门", "type": "Dtl" },
    { "progress": "30", "Department": "化验部门", "type": "Dtl" },
    { "progress": "20", "Department": "机械部门", "type": "Dtl" },
    { "progress": "20", "Department": "计控部门", "type": "Dtl" }
];

// 用户ID
let id = getUrlParam("id");
$(function () {
    GetUserRole();
});
//获取用户权限
function GetUserRole() {
    // let thisdata = [];
    // thisdata.push(InitRole(id));
    let USERdata = InitRole(id);
    if (USERdata != null) {
        InitData();

    }
    else OpenErrmsg("../../web/errhtml/404.html");
}
function InitData() {
    $('#dg_WorkPlanList').datagrid({
        data: data
    });
}

function formaterProgress(value, row) {
    //进度在后台算好 百分比
    let progress = value;
    let text = "";
    if (value > 10) text = value + "%";
    if (row.type == "Total")
        return "<div class='proparent_red'><div class='prochild_red' style='width:" + progress + "%;'>" + text + "</div></div>"
    else
        return "<div class='proparent'><div class='prochild' style='width:" + progress + "%;'>" + text + "</div></div>"
}
